// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';


// 申明请求对象
const calUserRequest = {
    // calPlan请求的基本url
    BASE_URL : confing.CAL_URL + "/calUser",

    // 现有用户列表展示 分页
    list(page = 1,limit = 10,calUser,callbcak){
        // url
        let url = this.BASE_URL + "/list?page=" + page + "&limit=" + limit;
        if(calUser){
            if(calUser.userName){
                url += "&userName=" + calUser.userName;
            }
            if(calUser.tel){
                url += "&tel=" + calUser.tel;
            }
        }
        // 发送请求
        request.get(url,callbcak);
    }

}

// 将calUserRequest暴漏出去
export default calUserRequest;
